package cn.zyq.ykb.beans.product;

import cn.zyq.ykb.beans.user.User;
import cn.zyq.ykb.system.common.BaseBean;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 商品对象 product
 *
 * @author SystemAuth
 * @date 2023-11-02
 */
@Data
@Entity
@Table(name = "`product`")
public class Product  extends BaseBean implements Serializable {
    /**
     * 主键id，用于关联
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "JDBC")
    @Column(name = "`productID`")
    @ApiModelProperty("主键id，用于关联")
    private Integer productID;
    /**
     * 标题
     */
    @Column(name = "`title`")
    @ApiModelProperty("标题")
    private String title;
    /**
     * 原价
     */
    @Column(name = "`price`")
    @ApiModelProperty("原价")
    private BigDecimal price;
    /**
     * 图片
     */
    @Column(name = "`picture`")
    @ApiModelProperty("图片")
    private String picture;
    /**
     * 详情
     */
    @Column(name = "`details`")
    @ApiModelProperty("详情")
    private String details;
    /**
     * 商品类型ID
     */
    @Column(name = "`productTypeID`")
    @ApiModelProperty("商品类型ID")
    private Integer productTypeID;
//    /**
//     * 商品链接ID
//     */
//    @Column(name = "`productLinkID`")
//    @ApiModelProperty("商品链接ID")
//    private Integer productLinkID;
    /**
     * 试看时间（单位秒）
     */
    @Column(name = "`tryTime`")
    @ApiModelProperty("试看时间（单位秒）")
    private Integer tryTime;

    @Transient
    private boolean IsPay = false;

    @Transient
    private String link;

    @Transient
    private String fileLink;

    @Transient
    private BigDecimal yhPrice;

    @Transient
    @ApiModelProperty("支付宝支付方式1 安卓 2 IOS")
    private Integer phoneSystems;

    @Transient
    private ProductType productType;

    @Transient
    private List<ProductLink> productLink;

    @Transient
    private User user;

    @Transient
    private ProductOrder productOrder;
}
